#pragma once
#include <string>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <iostream>

class InetAddr
{
public:
    InetAddr(sockaddr_in* sock)
    :_sock(sock)
    {
        _ip = inet_ntoa(sock->sin_addr); //#include <arpa/inet.h>
        _port = ntohs(sock->sin_port); //#include <arpa/inet.h>
    } 
    std::string PrintDebug()
    {
        std::string info = _ip;
        info += ':';
        info += std::to_string(_port);
        return info;
    }
public:
    std::string _ip;
    uint16_t _port;
    struct sockaddr_in* _sock;
};